import http from "@/utils/http";
import {GW,YN_STREAM,CLIENT} from "@/common/const";


// todo
// import http from "../../modules/http";
/**
 * 获取直播室ID
 * @param {Object} params
 * @param {Number} params.productId - 用户ID
 * @param {Number, Optional} params.limit - 请求条数
 * @param {Number, Optional} params.cId - 栏目id
 *
 * @return {Promise} Array
 */
 export function queryByRoomid (option) {
  const url = `${CLIENT}/client/queryByRoomid.htm`;
  const params = {
    ...option,
  };
  return http.get(url, params );

};

/**
 * 获取直播内容信息
 * @param {Object} option
 * @param {Number} option.currentPage - 页码
 * @param {Number} option.pageSize - 每页条数
 * @param {Number} option.roomid - 直播室ID
 * @param {String} option.clientCentralToken -token
 * @return {Promise} Array
 */
export function broadcastingList(option) {
  const url = `${CLIENT}/client/broadcastingList.htm`;
  const def = {
    currentPage: 1,
    pageSize: 20,
    roomid: "",
    clientCentralToken: "",
    ...option
  };
  const params = Object.assign(def, option);
  return http.get(url,  params);
  
}

/**
 * 获取首页直播预告
 * @param {Object} option
 * @param {String} option.productId: 产品ID
 * @return {Promise} Array
 */
export function queryShowYeMarketChargeLiveList(option) {
  const url = `${CLIENT}/client/queryShowYeMarketChargeLiveList.htm`;
  const params = {
    ...option,
  };
  return http.get(url, params);
};

/**
 * 获取玉龙版高级股池栏目
 * @return {Promise} Array
 */
export function showStrategyStockPoolColumn(option){
  const url = `${CLIENT}/client/showStrategyStockPoolColumn.htm`;
  const params = {
    ...option,
  };
  return http.get(url,params);
};

/**
 * 获取策略股票池列表
 * @param {Object} params
 * @param {String} params.productId 产品ID
 * @param {Number} params.limit 条数
 * @param {Number} params.cId 栏目ID
 *
 */
export function getStrategyStockPoolList (option) {
  const url = `${CLIENT}/client/getStrategyStockPoolList.htm`;
  const params = {
    ...option,
  };
  return http.get(url, params);
};
